package com.server.controller;

import com.eureka.bean.AbsInstance;
import com.server.database.DataSource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description: 记得注册到自动配置中
 *
 * @author weiruibai.vendor
 * Date: 2023/1/29 15:38
 */
@RestController
public class EurekaServerController {

    @GetMapping(value = "test")
    public Object test() {
        return "OK";
    }

    @PostMapping(value = "/add")
    public void save(@RequestBody AbsInstance instance) {
        DataSource.add(instance);
    }

    @PostMapping(value = "/remove")
    public void remove(AbsInstance instance) {
        DataSource.remove(instance);
    }

}
